﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace FindProxy
{
    public class WebClientTimeout
    {
        public WebClientTimeout(int timeout = 12000)
        {
            this.Timeout = timeout;
        }

        private System.Threading.Timer t;
        private WebClient wc = new WebClient();
        public int Timeout { get; set; }
        public void DownloadStringAsync(Uri uri, int timeout = 8000)
        {
            this.Timeout = timeout;
            wc.DownloadStringAsync(uri);
            t = new System.Threading.Timer(
                      s =>
                      {

                      }, null, Timeout, System.Threading.Timeout.Infinite
                );
        }
    }
}
